home *** CD-ROM | disk | FTP | other *** search
/ Practical Web Pages 2004 September / PracticalWebPages-WPG13-09-2004-Coverdisc.iso / pc / Software / Toolkit / Sothink SWF Quicker 1.5 / data1.cab / Public_Files / Effects / ActionScript / Combination / Combination2.sqe < prev    next >
Encoding:
Text File  |  2004-06-14  |  3.5 KB  |  146 lines

  1. ========== Description Part Begin ==========
  2. name = "Combination2";
  3. description = "Two groups of characters, forming into two circles, are combined into one in the end.";
  4. version = "1.00";
  5. bin = "Combination2.bin";
  6. ========== Description Part End ==========
  7.  
  8. ========== Parameter Part Begin ==========
  9. $nCharacterCount(EDIT,INT,1,1 10000,"Total Characters ","The total characters using the special effect. The value is defined by the selected characters in the movie, but can not be changed in the property box.");
  10. $nFrameCount(EDIT,INT,5,5 5,"Total Frames","It indicates the total frames of actions. The total frames of the effect is probably more than it.");
  11. $nRadius(EDIT,INT,140,0 1000,"Radius","The radius of the arc, which consists of characters.");
  12. $nInterval(EDIT,INT,5,1 1000,"Interval","The time difference between the former character and the latter one beginning to change.");
  13. $nAlphaSpeed(EDIT,INT,5,1 1000,"Fading Speed","The speed of character fading.");
  14.  
  15.  
  16. ========== Parameter Part End ==========
  17.  
  18. ========== Function Part Begin ==========
  19. nFrameCount = 5;
  20. nCharacterCount = 12;
  21.  
  22. nRadius = 140;
  23. nInterval = 5;
  24. nAlphaSpeed = 5;
  25.  
  26.  
  27. nIsRun = new Array(nCharacterCount);
  28. nRotateArray = new Array(nCharacterCount);
  29. nRadiusArray = new Array(nCharacterCount);
  30. nCentreX = new Array(nCharacterCount);
  31. nCentreY = new Array(nCharacterCount);
  32.  
  33. nOldPosX = new Array(nCharacterCount);
  34. nOldPosY = new Array(nCharacterCount);
  35.  
  36.  
  37. for(i = 1;i <= nCharacterCount;i++)
  38. {
  39.     nRotateArray[i - 1] = 225;
  40.     nRadiusArray[i - 1]  = nRadius;
  41.     
  42.     this["c" + i]._x -= nRadius;
  43.     
  44.     nOldPosX[i - 1] = this["c" + i]._x;
  45.     nOldPosY[i - 1] = this["c" + i]._y;
  46.     
  47.     if(i == 1)
  48.             nIsRun[0] = 0;
  49.     else
  50.     {
  51.             nIsRun[i - 1] = nIsRun[i - 2];
  52.             nIsRun[i - 1] += nInterval;
  53.     }
  54.     this["c" + i]._alpha = 50;
  55.     
  56.     
  57.     this["c" + i].duplicateMovieClip("cc" + i + i,i);
  58.     
  59.     this["cc" + i + i]._y += nRadius;
  60.     this["c" + i]._y -= nRadius;
  61.     
  62.     this["c" + i]._visible = false;
  63.     this["cc" + i + i]._visible = false;
  64.  
  65.     
  66. }
  67.  
  68.  
  69. function fadeout()
  70. {
  71.     if(c1._alpha < 0)
  72.         gotoAndPlay(1);
  73.     for(i = 1;i <= nCharacterCount;i++)
  74.     {
  75.         this["c" + i]._alpha -= nAlphaSpeed;
  76.         this["cc" + i + i]._alpha -= nAlphaSpeed;        
  77.     }    
  78.     
  79.     
  80.     
  81.     
  82. }
  83.  
  84. function FadeoutAgain()
  85. {
  86.     gotoAndPlay(4);
  87. }
  88.  
  89.  
  90.  
  91. function fun()
  92. {
  93.     for(i = 1;i <= nCharacterCount;i++)
  94.     {
  95.         if(nIsRun[i -1] < 0)
  96.         {
  97.             this["c" + i]._visible = true;
  98.             this["cc" + i + i]._visible = true;
  99.             if(nRotateArray[nCharacterCount -1]  == 360)
  100.             {
  101.                 gotoAndPlay(4);
  102.             }
  103.  
  104.             this["c" + i]._x = Math.cos(Math.PI / 180 * nRotateArray[i -1]) * nRadiusArray[i -1]  + nOldPosX[i -1];
  105.             this["cc" + i + i]._x = Math.cos(Math.PI / 180 * (360 - nRotateArray[i -1])) * nRadiusArray[i -1]  + nOldPosX[i -1];
  106.             
  107.             this["c" + i]._y = Math.sin(Math.PI / 180 * nRotateArray[i -1]) * nRadiusArray[i -1]  + nOldPosY[i -1];
  108.             this["cc" + i + i]._y = Math.sin(Math.PI / 180 * (360 - nRotateArray[i -1])) * nRadiusArray[i -1]  + nOldPosY[i -1];
  109.             nRotateArray[i -1] += 5;
  110.             if(nRotateArray[i -1] > 360)
  111.             {
  112.                 this["c" + i]._alpha = 100;
  113.                 this["cc" + i + i]._alpha = 100;
  114.                 nRotateArray[i -1] = 360;
  115.             }
  116.  
  117.         }
  118.         else
  119.             nIsrun[i -1]--;
  120.     }
  121.  
  122. }
  123.  
  124.  
  125.  
  126. function again()
  127. {
  128.     gotoAndPlay(2);
  129. }
  130.  
  131.  
  132.  
  133.  
  134. ========== Function Part End ==========
  135.  
  136. ========== Frame Part Begin ==========
  137. $frame(fun,1,-1,"fun");
  138. $frame(fun,2,-1,"fun");
  139. $frame(again,3,-1,"again");
  140. $frame(fadeout,4,-1,"fadeout");
  141. $frame(FadeoutAgain,5,-1,"fadeout again");
  142.  
  143. ========== Frame Part End ==========
  144.  
  145.